﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using FH.Application.UserApp;
using FH.Core;
using Microsoft.AspNetCore.Mvc;

namespace WebSite.Controllers
{
    public class SettingController : FonourControllerBase
    {
        private readonly ISettingService _settingService;
        public SettingController(ISettingService settingService)
        {
            _settingService = settingService;
        }
        [HttpGet]
        public ActionResult Index()
        {
            AppConfig config = _settingService.GetAppConfig();
            return View(config);
        }
        [HttpPost]
        public ActionResult Index(AppConfig config)
        {
            _settingService.UpdateAppConfig(config);
            return View(config);
        }

    }
}